Problem 1 |
Repeat the problem in Convolutional NN > Autoassociation to remove the noise from a shape. Create a new project, select Deep Learning Network, General Purpose and Simulated Annealing in the new project dialog. The project name must be DeepRose. After creating the project, copy the following files from the ConvRose folder to the DeepRose folder.
Repita el problema en Convolutional NN > Autoassociation para remover el ruido de una silueta. Cree un nuevo proyecto, seleccione Deep Learning Network, General Purpose y Simulated Annealing en el diálogo de nuevo proyecto. El nombre del proyecto debe ser DeepRose. Después de crear el proyecto, copie los siguientes archivos desde la carpeta ConvRose a la carpeta DeepRose.
|
Step A |
Edit the Train.lab file, then execute the code. Train the deep learning neural network using Simulated Annealing and the Conjugate Gradient method. Edite el archivo Train.lab, entonces ejecute el código. Entrene la red neuronal de aprendizaje profundo usando Simulated Annealing, y entonces, use el método del Gradiente Conjugado. |
DeepRose\Train.lab |
//_______________________________________ 1. Network setup DeepNet net; net.Create(64, 2); net.SetLayer(0, 2, 10); // tanh net.SetLayer(1, 2, 64); // tanh //_______________________________________ 2. Scaling int i = 0; for (i = 0; i < 64; i++) { net.SetInScaler(i, -1.0, 1.0); net.SetOutScaler(i, -1.0, 1.0); } //_______________________________________ 4. Load and set the training set Matrix trainSetInput; trainSetInput.Load(); Matrix trainSetTarget; trainSetTarget.Load(); net.SetTrainSet(trainSetInput, trainSetTarget, false); //_______________________________________ 5. Train using simulated annealing net.TrainSimAnneal( 10, //Number of Temperatures 10, //Number Iterations 15, //Initial Temperature 0.001, //Final Temperature true, //Is Cooling Schedule Linear? 4, //Number of Cycles 1.0e-5, //Goal (desired mse) true //Use Singular Value Decomposition ); //_______________________________________ 6. Train using conjugate gradient net.TrainConjGrad(2500,1.0e-10); //_______________________________________ 7. Save the trained network net.Save(); |
Step B |
Edit the CheckTrain.lab file, then execute the code to check the training. (a) Compute the mean squared error for the network using the training set. (b) Plot the error for each training case. (c) Save the plot as a vector image (checkTraining.pdf and checkTraining.emf) (d) Show a polar graph of the output to verify that the network has reduced the noise. Edite el archivo CheckTrain.lab, entonces ejecute el código para verificar el entrenamiento. (a) Calcule el error medio cuadrático para la red neuronal usando el conjunto de datos de entrenamiento. (b) Cree una gráfica del error para cada caso de entrenamiento. (c) Guarde la gráfica como una imagen vectorial (checkTraining.pdf y checkTraining.emf) (d) Muestre una gráfica polar de la salida para verificar que la red ha reducido el ruido. |
DeepRose\CheckTrain.lab |
//_______________________________________ 1. Load the training set Matrix trainSetInput; trainSetInput.Load(); Matrix trainSetTarget; trainSetTarget.Load(); //_______________________________________ 2. Load the network DeepNet net; net.Load(); //_______________________________________ 3. Run Matrix output; net.Run(trainSetInput, output); double mse = ComputeMse(output, trainSetTarget); //_______________________________________ 4. Relative error Vector error = ComputeRelError(output, trainSetTarget); XyChart checkTraining; checkTraining.SetCaption("case", false, "Relative Error", false); checkTraining.AddGraphY(error, "Relative Error", 2, 1, 0, 255, 0); checkTraining.SetLogScale(false, true); checkTraining.SetLimits(0, trainSetTarget.GetRowCount(), 1.0e-10, 1.0); checkTraining.SetColorMode(2); checkTraining.SaveAndShow(); checkTraining.SavePDF(0.0); checkTraining.SaveEMF(); |
Step C |
Edit the Validation.lab file, then execute the code to validate the performance of the network. (a) Compute the mean squared error for the neural network using the validation set. (b) Plot the error for each validation case. (c) Save the plot as a vector image (validation.pdf and validation.emf) (d) Show a polar graph of the output to verify that the network has reduced the noise from the shape. Edite el archivo CheckTrain.lab, entonces ejecute el código para validar el desempeño de la red neuronal. (a) Calcule el error medio cuadrático para la red neuronal usando el conjunto de datos de validación. (b) Cree una gráfica del error para cada caso de validación. (c) Guarde la gráfica como una imagen vectorial (validation.pdf y validation.emf) (d) Muestre una gráfica polar de la salida para verificar que la red ha reducido el ruido de la silueta. |
DeepRose\Validation.lab |
//_______________________________________ 1. Load the validation set Matrix validSetInput; validSetInput.Load(); Matrix trainSetTarget; trainSetTarget.Load(); //_______________________________________ 2. Load the network DeepNet net; net.Load(); //_______________________________________ 3. Run Matrix outval; net.Run(validSetInput, outval); double mse = ComputeMse(outval, trainSetTarget); //_______________________________________ 4. Relative error Vector error = ComputeRelError(outval, trainSetTarget); XyChart validation; validation.SetCaption("case", false, "Relative Error", false); validation.AddGraphY(error, "Relative Error", 2, 1, 0, 255, 0); validation.SetLogScale(false, true); validation.SetLimits(0, trainSetTarget.GetRowCount(), 1.0e-10, 1.0); validation.SetColorMode(2); validation.SaveAndShow(); validation.SavePDF(0.0); validation.SaveEMF(); |